<?
	include("./connection.php");
		$connection=mysql_connect($server, $user, $passwd);
		$db= mysql_select_db($name_db, $connection);
		$sql="select * from tb_enquesta";
		$rs=mysql_query($sql, $connection) or die ("No s'obte cap resposta");
		$si=0;
		$no=0;
		$total=0;		
		while(row=mysql_fetch_array($rs) {
		if($row["si"]==1) $si++;
		if($row["no"]==1) $si++;
		$total++;
		}
?>
<html>
<head>
<title>Resultats</title>
</head>
<body>
<h1>Resultats</h1>
<h3>El Google nexus 4 a rebut <? echo $si;?> vots el <? echo $si*$total/100;?>%</h3>
<h3>El samsung galaxy 3 a rebut <? echo $no;?> vots, el <? echo $no*$total/100;?>%</h3>
</body>
</html>